package org.lanqiao.tjut.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.lanqiao.tjut.bean.TBAdminsBean;
import org.lanqiao.tjut.db.DBFactory;

public class UserLoginModel {
  public List<TBAdminsBean> getUserLoginInfo(TBAdminsBean adminB){
	//组织数据查询操作sql语句
	  String strSql="select * from tbadmins where admins_name = ? and admins_psw = ?";
	  //查询语句的sql参数
	  List<Object> lstParas=new ArrayList<>();
	  lstParas.add(adminB.getAdmins_name());
	  lstParas.add(adminB.getAdmins_psw());
	  //db层调用执行语句
	  List<TBAdminsBean> lstAdmins=DBFactory.getDBDriverInstance().query(strSql, new BeanListHandler<>(TBAdminsBean.class), lstParas.toArray());
	  //返回登录查询结果集
	  return lstAdmins;
	  
  }
}
